package com.atguigu.gulimall.order.config;

import com.atguigu.gulimall.order.inteceptor.LoginUserInteceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @version 1.0
 * @Author yanjingren
 * @Date 2021/7/6
 * @Description com.atguigu.gulimall.order.config
 */
@Configuration
public class OrderWebConfiguration implements WebMvcConfigurer {

    @Autowired
    private LoginUserInteceptor loginUserInteceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginUserInteceptor).addPathPatterns("/**");
    }
}
